﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Media;
using GalaSoft.MvvmLight;

namespace PPP.ViewModel.BaseModel {    
    /// <summary>
    /// A base ViewModel for dockable content. 
    /// 
    /// <list type="bullet">
    /// <item>
    /// <term>Author</term>
    /// <description>Sebastian Will</description>
    /// </item>
    /// </list>
    /// 
    /// </summary>
    public class PaneViewModel : ViewModelBase {

        #region Fields

        /// <summary>
        /// The title of the dockable content.
        /// </summary>
        private string _title = null;

        /// <summary>
        /// The contentId of the dockable content.
        /// </summary>
        private string _contentId = null;

        /// <summary>
        /// The selected state of the dockable content.
        /// </summary>
        private bool _isSelected = false;

        /// <summary>
        /// The active state of the dockable content.
        /// </summary>
        private bool _isActive = false;
        
        #endregion

        #region Consts
        #region PropertyName Consts

        /// <summary>
        /// The <see cref="Title" /> property's name.
        /// </summary>
        public const string TitlePropertyName = "Title";

        /// <summary>
        /// The <see cref="ContentId" /> property's name.
        /// </summary>
        public const string ContentIdPropertyName = "ContentId";

        /// <summary>
        /// The <see cref="IsSelected" /> property's name.
        /// </summary>
        public const string IsSelectedPropertyName = "IsSelected";

        /// <summary>
        /// The <see cref="IsActive" /> property's name.
        /// </summary>
        public const string IsActivePropertyName = "IsActive";
        

        #endregion
        #endregion

        #region Properties

        /// <summary>
        /// Gets the Title property.
        /// Changes to that property's value raise the PropertyChanged event. 
        /// </summary>
        public string Title {
            get { return _title; }
            set {
                if (_title != value) {
                    _title = value;
                    RaisePropertyChanged(TitlePropertyName);
                }
            }
        }

        /// <summary>
        /// Gets the ContentId property.
        /// Changes to that property's value raise the PropertyChanged event. 
        /// </summary>
        public string ContentId {
            get { return _contentId; }
            set {
                if (_contentId != value) {
                    _contentId = value;
                    RaisePropertyChanged(ContentIdPropertyName);
                }
            }
        }

        /// <summary>
        /// Gets the IsSelected property.
        /// Changes to that property's value raise the PropertyChanged event. 
        /// </summary>
        public bool IsSelected {
            get { return _isSelected; }
            set {
                if (_isSelected != value) {
                    _isSelected = value;
                    RaisePropertyChanged(IsSelectedPropertyName);
                }
            }
        }

        /// <summary>
        /// Gets the IsActive property.
        /// Changes to that property's value raise the PropertyChanged event. 
        /// </summary>
        public bool IsActive {
            get { return _isActive; }
            set {
                if (_isActive != value) {
                    _isActive = value;
                    RaisePropertyChanged(IsActivePropertyName);
                }
            }
        }

        /// <summary>
        /// Gets the IconSource property.        
        /// </summary>
        public ImageSource IconSource {
            get;
            protected set;
        }

        #endregion

        #region Constructors

        /// <summary>
        /// Initializes a new instance of the PaneViewModel class.
        /// </summary>
        public PaneViewModel() { }

        #endregion       

    }
}
